function wrap(fn) {
    return function (p) {
        return p.value ? fn(p.value) : ""
    }
};

module.exports = {
    wrap   : wrap,
    percent: function (p) {
        if (p.value)return p.value * 100 + "%"; else return "0%";
    },
    number : function (format) {
        if (typeof format == 'undefined' || format == "=")
            return wrap(function (s) {
                return s;
            });
        else if(format.startsWith("."))
        {
            //TODO
            return wrap(function (s) {
                return s;
            })
        }
    }
};